﻿using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using FluentAvalonia.UI.Controls;

namespace DevHub.WindowsApp.Pages.Help;

public partial class IconView : UserControl
{
    public IconView()
    {
        InitializeComponent();
    }

    private async void ShowClick(object? sender, RoutedEventArgs e)
    {
        if(sender is not Control control)return;
        if(control.DataContext is not Symbol symbol)return;
        var td = new TaskDialog
        {
            Title = "DevHub",
            Content = new Dialogs.IconDialog(symbol),
            FooterVisibility = TaskDialogFooterVisibility.Never,
            Buttons =
            {
                TaskDialogButton.OKButton
            },
            XamlRoot = (Visual)VisualRoot!
        };
        await td.ShowAsync();
    }
}